Offset subviews with the parent's abs coordinate
authorRichard Hult <richard@imendio.com>
Wed, 7 Jan 2009 14:16:46 +0000 (15:16 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:23 +0000 (10:15 +0200)
gdk/quartz/gdkwindow-quartz.c

index 7f94fa7380c5072900e6938323a567d10b834ea6..151f6784a9b8315ebf53ce50ef5a577349322aa6 100644 (file)
@@ -923,7 +923,10 @@ _gdk_window_impl_new (GdkWindow     *window,
 
        if (!private->input_only)
          {
-           NSRect frame_rect = NSMakeRect (private->x, private->y, private->width, private->height);
+           NSRect frame_rect = NSMakeRect (private->x + private->parent->abs_x,
+                                            private->y + private->parent->abs_y,
+                                            private->width,
+                                            private->height);
        
            impl->view = [[GdkQuartzView alloc] initWithFrame:frame_rect];
            
@@ -1835,6 +1838,8 @@ _gdk_windowing_window_get_pointer (GdkDisplay      *display,
   gint x_tmp, y_tmp;
   GdkWindow *found_window;
 
+  g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL);
+
   if (GDK_WINDOW_DESTROYED (window))
     {
       *x = 0;